use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, Debug, Clone, Default, Eq, PartialEq)]
pub struct UserType(u32);

impl UserType {
    pub const SYSTEM: Self = UserType(1);
    pub const NORMAL: Self = UserType(2);

    pub fn as_u32(&self) -> u32 {
        self.0
    }
}

impl From<u32> for UserType {
    fn from(value: u32) -> Self {
        UserType(value)
    }
}


#[derive(Serialize, Deserialize, Debug, Clone, Default, Eq, PartialEq)]
pub struct PasswordCryptoFormat(u32);

impl PasswordCryptoFormat {
    pub const PHC: Self = PasswordCryptoFormat(1);

    pub fn as_u32(&self) -> u32 {
        self.0
    }
}

#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct User {
    pub user_id: String,
    pub user_type: UserType,
    pub username: String,
    pub description: String,
}